/**
* All Rights Reserved , Copyright (C) 2020 , 青岛鼎信通讯股份有限公司
*
* SysApiNoticeTaskService
* 接口通知任务
*
* 修改纪录
* 2020-06-29 版本：1.0 zhanglongfei 创建。
* @version 版本：1.0
* @author 作者：zhanglongfei
* 创建日期：2020-06-29
*/
package com.topscomm.sys.service.impl;

import com.topscomm.pub.util.ConvertUtil;
import org.apache.commons.lang.StringUtils;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import com.topscomm.sys.service.ISysApiNoticeTaskService;
import com.topscomm.sys.service.impl.auto.SysApiNoticeTaskServiceAuto;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service(value = "sysApiNoticeTaskService")
@Scope(value = "singleton")
public class SysApiNoticeTaskService extends SysApiNoticeTaskServiceAuto implements ISysApiNoticeTaskService {
    @Override
    public String queryVersionIds(String whereSql) {
        //获取最大版本号的id
        Map<String,Object> whereMap = new HashMap<>();
        whereMap.put("whereSql", whereSql);
        List<Map<String,Object>> idList = this.queryMap(whereMap, "queryVersionData");
        List<Long> idsList = new ArrayList<Long>();
        for (Map<String,Object> idItem : idList) {
            idsList.add(ConvertUtil.convertToLong(idItem.get("id")));
        }
        return StringUtils.join(idsList,",");
    }
}
